<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Parle pattern matching</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="parle.constants.html">« 预定义常量</a></li>
      <li style="float: right;"><a href="parle.regex.chars.html">Character representations »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.parle.html">Parle</a></li>
    <li>Parle pattern matching</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="parle.pattern.matching" class="chapter">
 <h1>Parle pattern matching</h1>
<h2>目录</h2><ul class="chunklist chunklist_chapter"><li><a href="parle.regex.chars.html">Character representations</a></li><li><a href="parle.regex.charclass.html">Character classes</a></li><li><a href="parle.regex.unicodecharclass.html">Unicode character classes</a></li><li><a href="parle.regex.alternation.html">Alternation and repetition</a></li><li><a href="parle.regex.anchors.html">Anchors</a></li><li><a href="parle.regex.grouping.html">Grouping</a></li></ul>

 
 <p class="para">
  Parle supports regex matching similar to flex. Also supported are the following POSIX character sets: <code class="literal">[:alnum:]</code>, <code class="literal">[:alpha:]</code>, <code class="literal">[:blank:]</code>, <code class="literal">[:cntrl:]</code>, <code class="literal">[:digit:]</code>, <code class="literal">[:graph:]</code>, <code class="literal">[:lower:]</code>, <code class="literal">[:print:]</code>, <code class="literal">[:punct:]</code>, <code class="literal">[:space:]</code>, <code class="literal">[:upper:]</code> and <code class="literal">[:xdigit:]</code>.
 </p>
 <p class="para">
  The Unicode character classes are currently not enabled by default, pass --enable-parle-utf32 to make them available. A particular encoding can be mapped with a correctly constructed regex. For example, to match the EURO symbol encoded in UTF-8, the regular expression <code class="literal">[\xe2][\x82][\xac]</code> can be used. The pattern for an UTF-8 encoded string could be <code class="literal">[ -\x7f]{+}[\x80-\xbf]{+}[\xc2-\xdf]{+}[\xe0-\xef]{+}[\xf0-\xff]+</code>.
 </p>
 
 
 
 
 
 
</div>
</div></div></body></html>